package com.nondo.rdp.finance.service.impl.circle;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nondo.rdp.finance.domain.circle.CircleUp;
import com.nondo.rdp.finance.repository.circle.CircleUpRepository;
import com.nondo.rdp.finance.service.circle.CircleUpService;

@Transactional
@Service
public class CircleUpServiceImpl implements CircleUpService {
    @Autowired
    CircleUpRepository circleUpRepository;

    @Override
    public CircleUp save(CircleUp circleUp) {
        return this.circleUpRepository.save(circleUp);
    }

    @Override
    public void delete(Long id) {
        this.circleUpRepository.deleteById(id);
    }

    @Override
    public List<CircleUp> findAll() {
        return this.circleUpRepository.findAll();
    }

    @Override
    public CircleUp check(Long cid, Long uid) {
        return this.circleUpRepository.findCircleUpByCircleAndUser(cid, uid);
    }
}